<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/10/28
 * Time: 14:19
 */

namespace app\api\model\VideoUser;


use app\api\model\Index\VideoUser;
use think\Model;

class VideoUserLikeModel extends Model
{
    /**
     * 数据表名
     * @var string
     */
    protected $name = "video_user_like";

    public function video()
    {

        return $this->hasOne(VideoUser::class, 'id', 'video_id');
    }

    /**
     * @param $id
     * 查询一条数据
     */
    public static function finds(int $video_id, int $uid)
    {
        return self::where(['uid' => $uid, 'video_id' => $video_id])->find();
    }
}